package org.qiyu.live.msg.provider.config;

import java.util.concurrent.*;

/**
 * @ClassName: ThreadPoolManager
 * @Description: TODO
 * @Author zhangguangyan
 * @Date 2023/08/26/ 20:13:29
 * @Version 1.0
 */
public class ThreadPoolManager {
  public static ThreadPoolExecutor commonAsyncPool =   new ThreadPoolExecutor(2,8,3,TimeUnit.SECONDS,new ArrayBlockingQueue<>(1000
  ),new ThreadFactory() {
    @Override
    public Thread newThread(Runnable r) {
      return new Thread(r,"commonAsyncPool - "+ ThreadLocalRandom.current().nextInt(10000));
    }
  },new ThreadPoolExecutor.CallerRunsPolicy());
}
